package com.decent.ejfadmin.config;

import com.decent.ejfadmin.filter.ParamFilter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 参数过滤器配置
 *
 * @author weicx
 * @date 2018/08/22
 */
@Configuration
@Slf4j
public class FilterConfig {

    @Bean
    public FilterRegistrationBean filterRegistrationBean1() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new ParamFilter());
        registration.addUrlPatterns("/*");
        registration.setName("paramFilter");
        registration.setOrder(1);
        return registration;
    }

}
